package com.sleep.blog.vo;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.Data;

import java.util.List;

/**
 * @author Sleep-6000
 * @date 2021/9/29
 */
@Data
public class CommentVo {

    /**
     * 防止前端精度损失，把 id 转为 String
     * 分布式 id 比较长，传到前端时会有精度损失，必须转换为 String 类型进行传输
     */
//    @JsonSerialize(using = ToStringSerializer.class)
    private String id;

    private UserVo author;

    private String content;

    private List<CommentVo> children;

    private String createDate;

    private Integer level;

    private UserVo toUser;

}
